#include <string.h>
#include <stdio.h>

#define N 10

int main(void)
{
    int a[N];
    int b[N];

    // memset: byte-wise assignment
    memset(a, 0, sizeof(int) * N);
    memset(b, 20, sizeof(int) * N);

    for (int i = 0; i < N; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");

    // guess the result below
    for (int j = 0; j < N; j++)
    {
        printf("%d ", b[j]);
    }
    printf("\n");

    // copy b to a
    memcpy(a, b, sizeof(int) * N);
    for (int j = 0; j < N; j++)
    {
        printf("%d ", a[j]);
    }
    printf("\n");

    return 0;
}
